#pragma once
#ifndef USER_H
#define USER_H

#include <string>
using std::string;

//User的ORM类
class User{
public:
    User(int id=-1,string name="",string pwd="",string state="offline"){
        this->m_id=id;
        this->m_name=name;
        this->m_password=pwd;
        this->m_state=state;

        this->m_salt="null";
    }

    void setID(int id){this->m_id=id;}
    void setName(string name){this->m_name=name;}
    void setPwd(string pwd){this->m_password=pwd;}
    void setState(string state){this->m_state=state;}
    void setSalt(string salt){this->m_salt=salt;}

    int getId() { return this->m_id; }
    string getName() { return this->m_name; }
    string getPwd() { return this->m_password; }
    string getState() { return this->m_state; }

    string getSalt(){return m_salt;}

private:
    int m_id;             //用户id
    string m_name;        //用户名称
    string m_password;    //用户密码
    string m_state;       //用户当前状态（'online' or 'offline'）

    string m_salt;        //盐
};

#endif